export interface Version {
  id: string
  script_id: string
  version_number: string
  content: string
  comment?: string
  is_major: boolean
  changes_summary?: string
  created_by: string
  created_at: string
  updated_at: string
}

export interface VersionDiff {
  version1: Version
  version2: Version
  changes: Array<{
    type: 'added' | 'removed' | 'modified' | 'unchanged'
    line_number: number
    old_line_number?: number
    new_line_number?: number
    content: string
    old_content?: string
    new_content?: string
  }>
  stats: {
    added_lines: number
    removed_lines: number
    modified_lines: number
    unchanged_lines: number
  }
}

export interface VersionHistory {
  versions: Version[]
  total: number
  current_version_id?: string
}

export interface VersionStats {
  total_versions: number
  major_versions: number
  minor_versions: number
  latest_version: Version
  version_timeline: Array<{
    date: string
    version_count: number
    major_count: number
  }>
}

export interface CreateVersionData {
  script_id: string
  comment?: string
  is_major?: boolean
  created_by: string
}

export interface UpdateVersionData {
  comment?: string
  is_major?: boolean
}

export interface VersionSearchParams {
  keyword?: string
  created_by?: string
  start_date?: string
  end_date?: string
  is_major?: boolean
  limit?: number
  offset?: number
}